home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3747 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: newsfeed.tip.net!usenet
  2. From: mikael.berglund@amiga.pp.se (Mikael Berglund)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: MsgPorts and lists
  5. Date: 23 Feb 1996 20:01:16 GMT
  6. Organization: Uniplus Internet Access
  7. Message-ID: <1677.6627T1226T921@amiga.pp.se>
  8. References: <1527.6618T48T2102@amiga.pp.se> <4gd8uo$btm@sundog.tiac.net>
  9. NNTP-Posting-Host: a711011.dial.tip.net
  10. X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
  11.  
  12.  
  13. In a message 20-Feb-96 20:55:04 Darius Taghavy <dart@ycrdi.com> wrote:
  14.  
  15.  DT> Why?
  16.  
  17. Huh? :D Because the message does not belong to the window the handler
  18. currently popping messages is responsible for. It has to be returned to the
  19. message dispatcher so it can determine to which handler this message belongs.
  20.  
  21.  DT> Better solution: Walk the list in the main handler.
  22.  
  23. There's really no need for it since the windows are not parallell in
  24. execution. Remember that it is windows we are discussing and letting the
  25. handler arbitrarily pluck the messages of the list could screw up the order
  26. in which these events are meant to be.
  27.  
  28. As i described earlier, popping a message from the list, determine
  29. addressee, let the addressee take over until it finds a message not
  30. addressed to itself, returns control to the main dispatcher which decides
  31. the addressee for the returned message should be relatively effective with
  32. windows as one can assume that for the most part a stream of messages will
  33. be addressed to one special window before a new stream of messages to
  34. another window occurs.
  35.  
  36. What i really was wondering was: Would it be more effective to Disable(),
  37. examine addressee, Enable(), offer control to the addressee, who GetMsg()
  38. until a message is not addressed to itself, Disable(), put message back in
  39. list, Enable(), return control to the main dispatcher? And is it legal to
  40. mess around with the message lists? The last question i have got an answer
  41. and that is yes. The other remains.
  42.  
  43. As i see it it would avoid argumentpassing between libraries, cleaner code
  44. with less 'if's making the code possibly smaller and more effective.
  45.  
  46. --
  47.   Regards TMB    PGP public key available
  48.  
  49.